import { FC } from "react";
import { List, AutoSizer, WindowScroller } from "react-virtualized";

type IProps = object;

console.log({ List, AutoSizer, WindowScroller });

const rowRenderer = (param: { key: string; index: number; style: object }) => {
  const { key, index, style } = param;
  return (
    <div key={key} style={style}>
      Row {index}
    </div>
  );
};

const TestReactVirtualized: FC<IProps> = () => {
  const listHeight = 300;
  const rowCount = 1000;
  const rowHeight = 20;
  return (
    <div>
      <List
        width={300}
        height={listHeight}
        rowCount={rowCount}
        rowHeight={rowHeight}
        rowRenderer={rowRenderer}
      />
    </div>
  );
};

export default TestReactVirtualized;
